package LanQiao._13JavaB;

import java.util.Scanner;

public class _5求阶乘 {

    //WA 60%
    public static void main(String[] args) {
        Scanner scan = new Scanner(System.in);
        //在此输入您的代码...
        long k = scan.nextInt();
        long count = 0;
        long N = 0;
        while (count < k) {
            N += 5;
            long helper = helper(N);
            count += helper;
        }
        if (count == k) {
            System.out.println(N);
        }else {
            System.out.println(-1);
        }
        scan.close();
    }

    public static long helper(long num){
        long res = 0;
        while (num % 5 == 0){
            num /= 5;
            res++;
        }
        return res;
    }

    //AC
    //二分查找 + 阶乘后的零
    static class Solution{

        public static void main(String[] args) {

            Scanner scan = new Scanner(System.in);
            //在此输入您的代码...
            long k = scan.nextLong();
            long left = 1L,right = Long.MAX_VALUE;
            while (left < right){
                long mid = left + (right - left) / 2;
                if (helper(mid) >= k){
                    right = mid;
                }else {
                    left = mid + 1;
                }
            }
            if (helper(right) == k){
                System.out.println(right);
            }else {
                System.out.println(-1);
            }
            scan.close();
        }

        public static long helper(long num){
            long res = 0;
            while (num != 0){
                num /= 5;
                res += num;
            }
            return res;
        }

    }

}
